Fixes #17 and #19