Fixed logic in allocation loop to use correct delay.