Minor editing of Python samples.
Added some further tests.