Fixed build bugs