ticket:16 javascript fixes