fixes and closes #240