Fix bugs in a few things.