Fix cannot set symlink to index

Before this fix, it could only unset symlink to index

Signed-off-by: Sup Yut Sum <ch3cooli@gmail.com>