fix minor bugs in data.js

Signed-off-by: Roger Manich <roger.manich@gmail.com>