a few fixes discovered during synthesis