Add error checks for arguments.