CheckForNull annotations, removed unused imports
made modifications based on Tillerino's suggestions

Signed-off-by: ThePooN <thepoon@cartooncraft.fr>