Made WINE_NAME optional in WS_ADVANCED_SEARCH. Fixed minor bugs