Fix tests for py27