fix tests and update to py3