remove useless cast and fix typos in comment