Simplify and improve (performance-wise) Z_Free.