Fix some building errors