Fixes rewrite issue