Port some leftover changes from the L3 branch