Add julia fns
Add julia fns
Fix bugs exposed by running real code.