Issue #22: add nonempty test
Issue 22: Add MalformedData test
Issue #22: add cases for tests