Fixes an issue of unexpected message payload in a timeout message

Also added some more sanity checks.
Merge pull request #1678 from tinwelint/2.0-instanceid-payload-fix

[Post 2.0, hold off merging] Fixes an issue of unexpected message payload in a timeout message