Fixes #15, #20.