Fixed error occuring when dataset was empty.