bug fixes

#14, #15, #1, #10, try to fix #11
Merge branch 'dev'

* dev:
  bug fixes