Nicer way of checking .meta extension.
Fixed typo (endswith).