Lateral effects in high-speed photodiodes