Py3 fixes (only 5 tests failing)

The permssion test are failing. Tried fixing that too but i'm definetly gonna need help from someone on this.