Fixed bug; forgot to require 'fs' module.