Fix error in log offset/limit logic