Unit tests and fixes for weak function proxy.