Improved class loading; still problems with magic value