We examine the Detrended Fluctuation Analysis (DFA), which is a well-established method for the detection of long-range correlations in time series. We show that deviations from scaling that appear at small time scales become stronger in higher orders of DFA, and suggest a modified DFA method to remove them. The improvement is necessary especially for short records that are affected by non-stationarities. Furthermore, we describe how crossovers in the correlation behavior can be detected reliably and determined quantitatively and show how several types of trends in the data affect the different orders of DFA.