Fixed a few bugs, including a crash if you add too many datasets