First pass at Python 3 compat