Fix returned pointers from lib, fixes #87