ensure we never send undefined values

and add some missing semicolons