Fixed some bugs with Switch extension