Fixed double-speed bug and replaced -O2 with -O3