Update documentation, remove unneeded depenancy and code more defensively.