Fixing bug #3165.