Do not compare NULL layers (cf #43)