Fixes for #31
Merge branch 'dev' into ms