fixes #718

Also removes some dead code that #715 made obsolete