fixes and closes #662