Patch for ticket #1407