Ticket 6117

Replaces #6124