Switched to c99, fixed all warnings