Fixed bug causing segfault when using g++ -Ofast