Check for array type in conditionals and !empty instead of count