Fixed simplify expression on RD

Also added a test (which seems to cause a few problems with the
interface).