Fixing some bugs (Unfinished)