Fixed a few missing casts and semicolons.