Added unit tests.
Improved coding style.
Improved spelling: "unitialized" -> "uninitialized"