Added drag and replace layers, some fixes