Made "bring to front" code more accurate in selecting application.