Initialise variables safely.