Improved logging + debug with -d arg