Added preventive checks for buffer allocation