Tried to fix problem with infinite cycling; failed.