Custom fields bug fixes
Fix bugs and refactor custom fields and global settings
Improve custom fields and form controls