Fixes #49, thanks to #tjmb