some bugfixes resulting from an attempt at usage :)