Fix type and vicinity bugs.