Bug fixes. Updated docs.