[DF-3871] Fixed bugs in DF-3871 and DF-3178