Fixed error detection for arguments. Check before assignment instead of the other way around.