Fixed some bugs that were still hanging around.