Task #5007 - Fix bugs from task #4499.
Merge pull request #243 from bvcosta/task5007

Task #5007 - Fix bugs from task #4499.