Code Style
NPE fixed
Client test added