Some fixes to little bugs