added test, updated docs, fixed null object warning