Improved argument checking