Apply Jeff`s patch from ticket: 3145
Refs: 3763