Fixed a couple of syntax errors

We are running this branch in production at Pulse and had to make a few changes to get it to work.