Fix crashes and make it working with helm

balance-windows is crashing emacs, it have been removed, which cause a wrong calculation of window size before resizing but it is usable.