try to fix warnings and small bugs