Bug fix + a small improvement