Fix random behaviour

Signed-off-by: Davy Meers <davymeers@hotmail.com>