Bug fixes and improved support of nullable types