Simplify event handling in the Preferences class
Improve error messages
Add more tests for the publish workspace API