Added parameter array checking

Testing:
Checks the parameter array to ensure the correct number of values inside
the parameter with sequential integer indexes.

Production:
Strips out any non-integer indexes from the parameter array inside the
_log_query function.