Fixing bugs and various