Fixed scaling and segfault