Downgraded from php 5.5 to 5.4 to help ensure this works for everyone.
Changed empty() using expressions to use only vars, 5.4 support.