Switching behaviour fixes

This pull request addresses the following issues: #24 , #14 , #11 , #8 

Additionally, all fixes in the switching-behaviour and editor-fixes branches have been merged into all-fixes branch. Could simply merge the all-fixes branch instead. There will be a conflict when trying to merge after the editor-fixes branch and this has been already addressed in the all-fixes branch.