Improved potential error messages. Fixed NPE

getResources() seems to cause a null pointer exception on startup...