Fix -Wall -pedantic warnings