Cleaned up error reporting and insert loc attribute settings.