added test and fixed changing passed in object within ctor