[#16] small corrections and code improvement