Fix bug and docs