Preferences menu and bug fixes
Merge conflicts resolved