Fixed the last legacy issues with sscanf.

Also some cosemtic changes.