Added extra sanity check.
Fixed bug with service caching.