Fixing bugs, final changes