Don't assign inside a conditional

Also, use #is_a? instead of === for clarity and consistency.