Fixes issue #441: InvalidRequestException should be HttpException