Fixed test and added more jsdoc comments