Cleaning up code

I removed a corner case that is not happening in the unit tests, though
I'm not sure if it won't happen in the future.