Fixed base layer switch and some other minor fixes