More debug output and more flexible option handling.