Fixed PHP < 5.5 compatibility with arbitrary expressions.

Fixed issues referenced in #156 dealing with arbitrary expressions and empty() not working in PHP < 5.5