small changes to get this module working with python3...