Enhance tests and fix the service bug.