Use monitor.Enter()/Exit instead of lock (closed #16)