Some fixes, having run some tests