Some bug fixes and perf improvements to observable.