Updated namespace and fixed minor bugs.