Support for internal errors
Code generation for fields
Test tweaking