improve error messages on failure to load
fix warning