fixed some variable placement issues from s///