Various fixes discovered during