Much better docs; minor bug fix