Fixed some bugs with mixed types