Fixed issue of shutdown when billing service was used.
Refactored for a NPE if.