Fixed two greg problems in insertion and updating