bb5ed865 caused a bunch of problems
This is probably the ugliest fix possible, but i'm too annoyed to create a better one. If this is not good enough, please poke @cblack