Final fix for #62. Thanks @corradomatt