Yeah, Miles is a medium (well, that's how i'd define his 'profession/'gift') and so he can speak to the dead..who give him the old headsup.
I'm wondering whether it was 'Libby' who told him that his name wasn't KJ - not that it matters which spirit it was, but it would add a little context seeing as Michael goes on to see 'Libby' on the freighter.
I'm also wondering whether perhaps the dead don't actually speak to Miles (the dead grandson didn't exactly have much to say for himself, did he?)..perhaps they merely 'whisper', and Miles is able to hear their whispers. I think this would also make sense as the whispers on the island often mumble amongst themselves, making observations and whatnot..
