fix issues with previous 2 commits. fixes #378