added some basic argument validation/normalization