added -Wall and fixed compiler warnings