Layout gsub fix