Fix all -Wall, -Wextra and -pedantic warnings/errors.