improve handling of malformed data
fixes #45
Merge pull request #46 from JamesCohen-awin/issue-45

improve handling of malformed data