Fix python 3 error in fields