Added case insensitve classification and arithmetic overflow check