Cleanup of references