BL: Added null checks. Fixed #1093