Fix py2/3 floor division
Added Python 2/3 integer check
Misc. Python 2/3 fixes.