Fix issue #37 - apps being assigned to wrong levels