fix warnings and hints reported by analyzer