Fixed most -Wall warnings