Various fixes from a long time ago