Some fixes

Fix compiler warning
Fix potential leak
Fix crash if smc failed to get current authorization during first use
Add a .gitignore