More cleanup for compatibility with upstream