fixed some bugs + small tweaks