Fixed issues with datom insertion