Safe mode bug patch
Merge branch 'master' into gh-pages