Fixed some bugs in handling local push notifications