Fix after/before scripts