Further fixed error handling. Because python is a finicky bastard