Memory fixes and comments.

Signed-off-by: Phill Apley <pga@enflight.com>