Minor code rewrite.

Use last' function.