avoid race condition on sensors; other small improvements
Merge branch 'master' into gh-pages