Fix possible bugs when topBlock or fillerBlock are null