Fixed the bug concerning the empty factors.