Merge "Fix overflow check and check read result" into klp-dev