Porting alanjds fixes to newer release