do not ignore errors, remove unused error return values

Great care has been taken to make sure the exported API remains
unchanged. Also, tests are fixed