Added a few validate checks to clear up any potential NPEs