Code cleanup.
Updated for 1.6.4 and added missing lib.