Fixed to_file() method to return true or false.