Added checks to make sure the connection is OK before trying to run queries, made code running queries support a null return value and fixed stupid "0 seconds" message.