Fixes made for issue 4623

Fixed WMExceptions code and duplicate/incorrect errors. issue 4623