added more descriptive error for length mismatch; better expection type; cleaned up
added more descriptive error for length mismatch; better expection type; cleaned up

oliverhuangchao/thunder,oliverhuangchao/thunder,kunallillaney/thunder,poolio/thunder,j-friedrich/thunder,mikarubi/thunder,thunder-project/thunder,pearsonlab/thunder,j-friedrich/thunder,jwittenbach/thunder,zhwa/thunder,zhwa/thunder,kunallillaney/thunder,kcompher/thunder,kcompher/thunder,pearsonlab/thunder,poolio/thunder,mikarubi/thunder,broxtronix/thunder,broxtronix/thunder