You're correct on the typo.  I think the logging can be useful since there are many types of objects that can be encoded into a PEM file; so this gives you a way to make sure it's reading what you think it should be.