Fixed merge conflict
Added some argument checking