Layers update, bugfixes