Fixes #23 and closes #24