Fix compile order (bug #1682)