Fixed an NPE and updated documentation.