Small fixes and cleanups to multipass encoding