This error handling seems… wrong.