Fix some out-of-tree build bugs