Further attempts to port the kernel to python3