FIX bugs by Tocsa