fix some bugs, clean some stuff up