Fixes #9, #13