A couple of fixes for oddities in the code.