* Access lastObject using a method.
 * Use string length instead of a nil check.

Hat tip @sendhilp