refactored bounded scans, corrected null handling