Fixed #111 - Removes Python error.

Added test to check it works.
Added tests to address issue #123.