Minor updates to make the python code a bit cleaner.