Fix some building issues