Fix bugs with inserts, inheritance and decimal lookups