Fixed a handful of null pointer exceptions
Minor adjustments