Added delete callback in object listener.
Fixed some ref counting bugs.