Debug Jedi

Big debugging work
Some bugs left