Fixes #5, hopefully correctly this time :)