PLF-5811: Added unit tests and fixed the last remark