Fix priority map and missing code