Fix checkLocalNames

Also cleanup in using __METHOD__ instead of __FUNCTION__, use
wfGetDB directly instead of wfGetLB.

Change-Id: Ic40e8cd2511491445f530faadd6fdf5a2873a5e2