Fixing bugs with longTrading and missed periods