Minor reworks, fixed some bugs
Minor tweaks