Fixed handling of missing data. Closes #10.