BUG FIX. MAJOR CHANGES.