Issue 509 - Fix for nullpointer 

Fix for npe. Updated logging to include message ids.
Added delay before the initial reconnection attempt.