Fixed a bug where sometimes it would fail.