fixed internal inconsistencies