Fix compile errors.
Implement conditional selects to prioritize tasks.