Minor bugfixes functions