Better handling of btn switch
Merge branch 'master' into gh-pages