Clean bug fixes for issue / PR #975. Closes #975