I'd forgotten to set the result flag. Unfortunately, the errors can get very bad (1e-3) it seems :(
It seems to be a little sloppy (an error of a bit less than 1e-4). This might be why I'm having trouble with my SEB code.