Fix crash-on-load and other bugs; remove unused debug logs