Added some logs and error handling in file fields parsing

As per title.