Fixing bug (partially)