Fixed a bug in forecast