More bug fixes

Fixed silly table output bug
Made outputted HTML more tidy
Fixed hiding of table