Fix #46 and fix #47
Merge branch 'bugfix-#46-#47' into develop