Add replace test
Fix basedir