Cleaned imports
Fixed up some null checks