M-th from end element fix