Fix result handling.
Removed debug printf.