Fix a few bugs found while testing new programming elements.