Fixed arrayref and base filename error