Fixes #4, fix yaml parsing, code clean-up