Fixes #18 and #20