More buffer overflow checks from Corydon76.