Documentation in code and some small fixes