result handling fixes