betterness

I can't test this because it segfaults OSX and FreeBSD, but it should work :P