fixed a bug in division simplification