Fixed #4429 (unused functions: handle function declarations better)