Pythonic fixes to /lib