Fix some entity repository