Fixed Entity registration bugs.