Global leaks, missing semicolons and wrong function name