When did the father of Frederick IV of Denmark die?