Modify comments and code layout
Improve custom field error handling and add TU for it