Fixes for issues raised after pull request was made.