Made tests backward compatible with python 2.6 and fixed some more deprecation warnings