Fix issue with popup

I was seeing error messages with the popup because it could not find the addCssClass variable in scope.
Also fixed what looked to be a broken ternary operator.