Fixed a bug that was causing the base method to not wrap properly due to buildWrappedFunction returning from the while loop to early.