Improved layer switching and minor adjustments