Minor updates to the logic.