Make tests slightly more Python 3 compatible