Fixed casting float-int and added invalid type error