Various fixes

Signed-off-by: Lewis Marshall <lewis@lmars.net>