Various bug fixes, supporting file arrays