ip-node: fix wrong cast and add more sanity checks

4 jobs for develop in 1 minute and 29 seconds (queued for 2 seconds)