Make sure load SPAs gets called only once, and improve tests