Added more checks for arguments