Issue #524 Layer counting fix for labels layer