Added argument checking and setting functions