Added more error checking for the main startup and request parsing.