bugfixes closes #245 and closes #244