Merge branch 'pr/400' - fixes #397