Fix issue MR-340 - Object reference not set to an instance of an object.