ScalaSTM + minor changes