Tweaks for running under sbcl.
Rearranged functions to avoid undefined warnings.
Tweaked code to avoid warnings.
Moved function to avoid warning.
Tweaks for completeness.