Fixes for IDENTITY-2821 by TharinduE