Cleanup some legacy error checking code