The first and the last line in FFT contain only half of the power, because FFT is symetric. That is why we need to multiply them by two.
The df is also compensated. There is a simple test to check the window: create an formula with (for an example) sinewave of 100 Hz, choose sample rate of 1024 and calculate the FFT. The sine wave result will fall exactly on the frequency line of the FFT.
The correction factors compensates the window characteristic for all windows that the amplitude is always correct (1 in our case). If you enable RMS value, also the RMS value will be correct all the time.
When the frequency is set to fall in between the lines, the amplitude will be wrong depending on window side lobe characteristic, but the RMS will still be perfect.
With this simple test we prove the correctness of the factors.