fixes #653
fixes #648
left in debug from #651 fix