Move sanity checks to the right position