Fix a lot of bugs
Fix idep bug