a lot of bugfixes
Merge branch 'master' into gh-pages