Fixed a bug when a getter returned null

Improved exception handling
Merge origin/master