Fix canDelete to correctly use published. Add default 1 to version field to make sure the versioning feature works as expected.