Bugfix for when Params aren't where we expect them to be. Also added a debug mode (use '-d')