Fix memory issues with regard to blocks