Ensure correct handling of trailing slashes in user directory parameters