Fixes #28 (almost entirely)