Broader option handling, better debug logging