Improve handling of bad client requests