Added a "catch" in case the input array is empty (it must have at least one object... even if it's empty)
Added a "catch" for an unfound rule
Defaulted the input to an array with an empty hash
Defaulted the input to an array with an empty hash
Defaulted the input to an array with an empty hash
Defaulted the input to an array with an empty hash