Fixed #228 (thanks @altima)