Added basic argument checking