In what ways did nationalism help Napoleon?