Fixed some small errors and warnings