fixes for advanced search
fix for null in entity table
fix to select first row of table