innerHTML -> value

Tidying up, and minor bug fix