Fork from http://code.google.com/p/vartypes/