fixes #46 among other things it seems ;-)