adding tests and fix for #60 -- thank you @lhasiuk!