Fix directory format for trailing slash.