Add is_loaded constants and fix some compile errors with the generated loader