Fixing some bugs, not done