Some fixes to the previous commit