Fix possible bug and document another bug