Fixes #9, added #20