Improved error messages
Fixed problem with preferences