Fix: invert.rb makes sure a 'data' directory exists. It would crash while trying to write data if the directory is missing.