A few fixes to previous commit