#1 Fix freeing key object