Some more cleanups to get closer to upstream