Compile flags and build fix