Updated rdoc and fixed bugs.