Fixed some bugs
Merge branch 'master' into gh-pages