fixed problems with value types