Fixed issues for py2