Fix build with optimized flags