Fixed some type problems