Remove debug, proper null checks