Fixed memory corruption in mock backend