short version - act as if the coordinates (where you are deciding whether to generate things and where you will generate things) are offset by +8, +8. i.e. do offset them by +8,+8 both when checking the terrain and when generating your stuff.
the thing is - if you overflow to the east or south, you're okay. no problem. but if you overflow towards north or west, more chunks need to be created (which will among others call your terrain generators again, likely causing more chunks to be generated...).