Stability: workarounds to avoid hanging on function headers and on
unclosed functions