Adjust your float level to help with the fuel pouring out. Fuel will always come out of your overflow tubes when the bike is tipped far enough on its side. As for the rattle most likely just needs a new top end if is hasn't had one for awhile.
Get the new top end job done ASAP; I had that "rattling" sound in an old KDX years ago, but by the time I took it to a mechanic for a new top end, the cylinder had gotten damaged and had to be re-sleeved...$$$$$$. :(