minor python improvements