Do not free the data if it is set to 0.
Refracture code.

Looks nicer this way.