Use exceptions instead of returning null during errors