Fixing case bugs