Fix getting directory of scripts.