Fix nullpointer
Remove debug code