Updated extension to be fully Python 3 compatible