Fixed memory size checks.