Fix delay to work with reverse loop.