Fixing issues in bounding box checks for rendering