Turns out that extname returns the . as well as the extension?!