some corrections according to jlint