Fix minor javascript errors

@mnzaki