Fixes #32 and #34.