Found the real problem. Indentation issue in halfnode.py