Added field width limits.
Code refactoring and improved pointer handling.