Fixed possible crashes

Added extra validations and changed the enumerations to non-threadbloking enumerations for performance issues and possible indexes crashes. - 942v