some basic random expression generation facilities, unit test, and resulting bug fixes