Changes suggested by Habnabit (python wizard)