Check for errors when building SMT sorts recursively