More tests plus a few fixes mostly related to Py3