fix some warnings and errors