Fixed buffer overrun
Restored gcc and -O3