Final fixes and cleanup for issue-780.