added a minor cleanup so that some values returned 0 instead of null