fix warnings about filename on upload + some reindenting