fixed warnings and alloc