Fixed test cases, added node state to database