Removing redundant slashes before closing brackets