Fixes #38 and some minor stuff.