Simpler expression printing

#5871 with fewer bugs. :-)