Fixed bug where server would hang on invalid URLs