Added -Wall and fixed errors