Added check for valid traces in the initialization