Add documentation; Fix some minor issues