Added input sanitization so that script wouldn't read previously generated dat files