Do not fail when invalid buffer, fixes #39