Significantly speed up frame conversion; fix writing clouds.