Fixed a bug when checking if called method exists in trait