Fix null problems, add overflow test