Fixed #58 (mostly)