Now I remember why I didn't commit that last part... there was a double free problem. Fixed.