Fix bugs in simple JS version of life