Fixed WMExceptions code and duplicate/incorrect errors. issue 4623
Merge pull request #4685 from tsarangi/issueNumber4623

Fixes made for issue 4623