fixed some bugs and added BLEND::toString and BLEND::fromString