Fix a potential HTTP 500 (#165)