Cleanups.
Bug fixes.
Cleanup + small consolidation
Merge branch 'master' into gh-pages