Fixed search

Moved the magic around, now search works again.