Remove assertion about func.__code__ + minors changes