Bug fixes

I'm not sure if these work but I'm done for the night so here is the
latest greatest :)