various fixes

Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>