Some cleaning here and there. Backporting some functions to make equ-gui compilable with this version.