Fixed to work in release builds aswell, and to look more intuitive and correct