Cod review: fix undeclared variable, group declarations...