Fix bug where errors would not be passed to user via a 500