Added jvm ternary, fixed if bug