Fixes #28 and #30