Fixed not-null id check in fetch