Ticket #21622. Changes to better support custom app_labels.