fix #209
add test for #209
Merge pull request #301 from MagLev/tim/issue209

Tim/issue209