fix some warnings and minor issues