Updates and bug fixes.

Signed-off-by: Peter Hartree <web@peterhartree.co.uk>