Switched to allocating memory from the GC heap instead of the unmanaged heap when creating a command.