Better string checking, fixed judge name trimming bug