 
       addAfDefs def if af?
 
-    regEx = new RegExp "(#{SimpleSchema.RegEx.Id.source})|^0$"
+    regEx = new RegExp "(#{SimpleSchema.RegEx.Id.source})|^#{systemId}$"
 
     if createdBy
       def = definition[createdBy] =

  isLocalCollection = @collection._connection is null

  if Meteor.isServer or isLocalCollection
    @collection.before.insert (userId = '0', doc) ->
      if createdAt
        doc[createdAt] = new Date
      if createdBy and not doc[createdBy]?
        doc[createdBy] = userId

    @collection.before.update (userId = '0', doc, fieldNames, modifier,
      options) ->

      $set = modifier.$set ?= {}

  createdBy: 'createdBy'
  updatedAt: 'updatedAt'
  updatedBy: 'updatedBy'
  systemId: '0'

behaviour = (options = {}) ->

  {createdAt, createdBy, updatedAt, updatedBy, systemId} =
    _.defaults options, @options, defaults

  if ss?
