Fixed issue that caused an SQL syntax error when there were no results
Signed-off-by: Jason Raede <jason.raede@gmail.com>