fixes for type casts