Fixes for bugs in the python sensor methods and script