Port to gcc and fix keil project