Fixed another  variable to be tested before being used in a query.
Changed some error messages to be more descriptive.
Fixed search and searchResults to exit(0) after printing error, just so that nothing happens after someone mistakenly finds their way to a dead page by misentering url arguments