Clean up path before saving