Added an exit call after every heading("Location:...") redirector to prevent unwanted execution of code.
Added default charset option to settings