Fixed a bug in @delegates and fixed the unit tests to catch it