Fixed some bugs and made the code prettier.

I was too nice and let things start living when they only should
have survived.