Fixing the bugs CLINPORTAL-6788 & CLINPORTAL-7124