Bug fixes again
Fix memory leak, add mark as read/unread support