Initial batch of fixes from Caplin

3 commits for 3 different files. Each commit has the original commit message, jira number and the original developer.