Fix some borrowck errors