Fix secure mode reset
Merge branch 'master' into develop