Sort some variables and combine some unknown flags into requirements array.