Fixed lastz inputs and several other minor bugs.
Skip if a dataset is undefined.