Fix the hidden patches functionality (bug #9077)