Fixed bug in toSpy