more npe checks in muc packet parser
made presences synchronized
close cursor for database
Merge branch 'master' into development