Pythonic improvements.