Clear direction flag before calling a stalker C function

This is required by the ABI.
Fix indentation inconsistency
Clear direction flag before calling on_enter and on_leave