Improve checks of functions inside records
Add chunks_by.