Added type checking in assignments