better handling of Number classes

fix for #127