Clean xml issues
Fixed some memory leaks and warnings
UI improvements