Bug fixes in expression transformer/optimizer.