Fix/travis test fail

Travis keeps failing on a test. It's kind of a test bug, but the middleware should probably be written to return a better error as well.