Added null check for some operations