Some fixes to make it compile