Fixed NPE during code analysis on commit.
Fixed trying to acquire write lock on read lock.