Just read the file directly. Use safe_load instead of load
Fix some bugs in the executable