Fix small bug in forecast function