Fixed typos and added contracts checks for (now) public API. Updated for namespace conventions.