Minor fixes including lengths and semicolons.

Added semicolon to put statement.
Added length statements to prevent truncation problems.