Allow empty source in formula (with migration)

* Correctly use empty() under PHP < 5.5
Test results with formulas