fixes after AKindyakov code review #48