Output type handling (fixes #17)