Removed memory leak in x11,x13. Removed some dead code.