fixes bugs in handling of private within