changed safeintval to intval

See comments.