Fix for issue #294

Worked on the if/else construct to better help parse the unit field, since it could be either and array, string or bool.  Also, in_array was being a little bitch, so I tossed off something else for better array checking.