Added support for None returns from database