Fixed issue with storing incorrectly named files