Guard against NPE
Improvements and cleanup for service browser