Fix scoreMed to scoreMid, checks for undefined values