Fixes file pointer in test