- fix unittest
- Adds WeakReference for better memory footprint.