Make sure that the method removeType returns a filename

This solves bug 3498. The problem turned out to be that a method ( removeType(String) ) that removes the char ^ from the file name did not returned a file name if it the filename didn't contained that char. With this commit it returns the filename as it was sent in if it don't contain a ^, if the filename do contains ^ those are removed from the filename.