Bugfix in simplify