As I've said already, those two presence lines are coming from another connection. You will get broadcast every presence change for all resources connected to the server on your same JID.
If you log in as [email protected]
two times, each will connect and be assigned different resources (cb533e06 and 6b517963 are the two assigned here, 6b5... is the one for *this* connection). If the other resource disconnects, you will see the presence change to unavailable.
There is nothing you can change in the code to prevent this; this is how XMPP is specified and how implementations behave.
If you have stopped receiving messages at some point, it's probably because you got an exception in a stanza handler or forgot to "return true;" at the end of one. In both cases, the stanza handler will get removed and will not get called on any new messages.