fixed error handling bugs related to public files and added some better default error styles