fixing 2.7/3.3 compatibility problems