Task #5007 - Fix bugs from task #4499.