merged changes from .net client to java