Fixed shared object state and other small bugs