Some tidying up, an extra assert, whitespace fixes.