Fixing encoding errors
Adding in command line support