Fix YAML parser for stdin + add tests