fixed runtime tests and Lock exception handling
merged conflicts