Added check to avoid crash when outputting an empty file.
Fixed typo in variable name.
Merge pull request #17 from jchoude/fix-creating-empty-vtk

Added check to avoid crash when outputting an empty file.