Fixes #24, #13