Made scaling code more similar to minc1 api, added debug messages