Some minor but important fixes