Layer constructor. Correct handling of multiple layers.