Added test for open_file and fixed minor bug with map where the last yielded item was sometimes missed.