Minor style improvements
Minor clarifications
sprintf is _evil_. Don't use it!
Use constant time comparison.