A couple of fixes to frontend-rewrite

Change-Id: I98d0ab16a8a357c24b812537e22a50b17240114c
Merge "A couple of fixes to frontend-rewrite" into frontend-rewrite