This bit of code works, but I'm not sure why, or even if it's just an illusion of working, and here lurks a nasty bug?