Fixed dropLastN function with reverse.