Visual Studio compatible
Layer count bugfix