Second stage compiler fixes