fix a nubmer of warnings