No longer check on result !== false, result could also be null.
Added an test flag.
Also load the mode.