Fix for layering when using a key property other than 'id'