Added layers tab, fixed some bugs in other tabs