fixes on code and doc