Null point references bug fixed