Fixed invalid argument errors