Fixed bugs found so far