Removal of IFNULL from the sql and replaced with logic checks instead.  Errors are gone from error_log now.  Found faulty logic in the allocated sql statement that resulted in it only getting the number of U used by reserved devices close #229