Various java and javascript bits and pieces