Fix possible log spam & unneeded string check
Code style & cleanup