Changed error handleing of number of attributes >2