Small bug fix in reinit function