Fixed SQL queries for the top status box on homepage