Fixes #189. Merge branch 'issue189' into dev