Added test case and fixed bug, which caused uninitialized private variables to be left to code without initialization in some cases.