Minor Fixes in Python Code