fixed some bugs + misc things