Fixes #18, with thanks to Mike Kaply