Fixed a couple of minor bugs in tab-completion

The Python unit-tests now pass on the OCaml too.