Fix regexp and file ownership issues