Fixex minor bugs