Fixed some more bugs. Complex search now works