Improve argument validation