2.7 Fix

Corrected code so it works with 2.7