Some reformatting and fixes

Signed-off-by: Samuli Seppänen <samuli.seppanen@gmail.com>