replaceExtension should check if string and length. closes #1