Fixed prune_tasks. Fixed phase check in update_status.