Mark static functions as static.
Fix allocation issue.