Fixed some issues

Login didn't work in PHP < 5.5. And fixed Search filtering by health issues.
Fixed search