General code cleanup
Merge branch 'master' into multi-client