Returning optional for first and last methods and using nil instead of NSNull