Fixed NPE in scales