Clean up error code