Code cleanup
Fixed one minor bug in JS. Closed #24