Bug Fix

Some bugs have been fixed