Small patch by Aidil, to allow map_array to take a filename or an
object instead of just an object.