Minor fixes while porting to 2.4