fixing some issues raised in PR