add missing semicolons, fix prototyping