Fixed some bugs, removed useless code, added debug and support of (de)op