Added some NullDeleters to prevent wrong deletion of objects and added some debug output.