fix a bug in term normalization and get better bound variable naming