Bugfix in layers modue.