General improvements.

Signed-off-by: Niko Rosvall <niko@ideabyte.net>