Clear internal refs, fixes #2