Update in docs, plus various bug fixes