Minor more pythonic changes