Fix order of functions.