Fixed bugs from last changes.