Fix #686 - Ismall code tidy up.