Re-order scans, added logging

Changed the order of scanning steps and added more try/catch and some
logging for debugging.