Fixes and closes issue #659