#6 bugfixes. Closes #6