Reordered the logics around compile_queue()