Fixed patching error in tests and removed unneccessary line creation