Fix issues pointed out by soc