Fixed a bug in SGEntity and one in SGEvent.