Fix compile with optimization