Fixing some bugs
Merge errors