Fix bugs with caching

Method loadClassMetadata is called only once -  when cache is empty