Fix tests for python 3 and remove buffer nonsense.