fixed some small problems following by menber's comment.