Several bugs solved.