Fixed memory leak
Added zval separation test