Fixed small bug where filename terminated outside of array