Used correct format types to remove printf warnings and fixed some
unused variable warnings.