fix issue #10

  do typecasting on read instead of on write
  follow the active_attr pattern
  caused problems with reading the raw values out
  that had yet to be converted