Fixed Memcpy crash + performance improvements