Fix issue with popup

I was seeing error messages with the popup because it could not find the addCssClass variable in scope. It is present in the current object. Also fixed what looked to be a broken ternary operator.
Merge pull request #395 from gavD/master

Fix issue with popup