Fixed misc errors.
Changed transaction isolation to read-committed.
Fixed misc. bugs.