Changed join handling.
Added missing search index update and fixed search conditions.