Fixed memory leaks and added notification center support.