Maybe the fix is to feed a valid spHandle instead of guarding against Long.MIN?