You should test limit(), not nsimplify.  And, probably, limit() should return a float in this case...