Lot of minor fixes