Fixed up problems with the nth-child rendering

Signed-off-by: Kenneth Lim <kenlimmj@gmail.com>