Scan Fixes

Fixed several issues that prevented the scan functions from working.