pyhon 2 compatibility
fixed tests