BUGFIX: fixed error when creating an empty file