Makes it more stable

Before when we were setting the count to 0 if file_get_contents returned
a falsey value we could've hidden errors. Doing it this way we only set
the value to 0 if we're actually creating the file.