Little fixes on javascript