Fixed some bugs
more tweaks