FIX: Isolation level, and add lock table for other table types. Fix some bugs. Add tests